App({
  onLaunch(options) {
    console.log('App Launch', options);
    console.log('getSystemInfoSync', my.getSystemInfoSync());
    console.log('SDKVersion', my.SDKVersion);
   
  },
  onShow(options) {
     console.info(">>>>>>>>>>>>>>>>>>>>>获取《》》》》》》》》》当前用户信息")
     var that =this;
     var url = this.globalData.url;
      dd.getAuthCode({
      success:function(res){
        var code = res.authCode;
          dd.httpRequest({ 
            url:url+'/api/dinguserinfo/getInfoForXcx?code='+code,
            method:'get',
            datatype:'json',
            success:function(res){
              console.info(">>>>>>>>>>>>>>>>>>>>>当前用户信息")
              console.info(res)
              that.globalData.userinfo=res.data;
             dd.setStorage({
                  key: 'userinfo',
                  data:res.data,
                  success: function() {
                    console.info("userinfo存入缓存")
                  }
             });
            } 
          });
      }, 
      fail:function(err){  
      } 
    }); 


  },
  onHide() {
    console.log('App Hide');
  },
  globalData: {
    hasLogin: false,
    url:'http://localhost',
    sjId:'GSHK-SJXX-',
    code:'',
    userinfo:{},
    sendWorkUrl:"/api/dinguserinfo/sendWorkMsg"
  },
});
